<!DOCTYPE html>
<p>Test entering full screen for nested iframes.</p>
<p>To test manually, click into inner frame, the page should enter full screen mode.</p>
<script src="full-screen-test.js"></script>
<iframe allowfullscreen src="resources/full-screen-iframe-allowed-nested1.html">
</iframe>
<script>
window.onmessage = function () { // iframes have been loaded and messaged us.
  // Send click to center of iframe.
  iframe = document.getElementsByTagName("iframe")[0];
  x = iframe.offsetLeft + iframe.offsetWidth / 2;
  y = iframe.offsetTop + iframe.offsetHeight / 2;
  if (window.eventSender) {
      eventSender.mouseMoveTo(x, y);
      eventSender.mouseDown();
      eventSender.mouseUp();
  }

  window.onmessage = function (messageEvent) {
      consoleWrite(messageEvent.data);
      endTest();
  }
}
</script>
